# 练习4

# 2.
# li = ['alex','  aric','Alex  ','Tony','rain']
# b=[]
# for i in li:
#      a=i.strip(' ')
#      b.append(a)
# print(b)
# for j in b:
#     if j.startswith(('A','a')) and j.endswith('c'):
#         print(j)
# li = [str(i) for i in li]


# dic =  {'K1':'alex','K2':'  aric','K3':'Alex  ','K4':'Tony'}
# for i in dic:
#     dic[i]=dic[i].strip(' ')
# print(dic)
# for j in dic:
#     if dic[j].startswith(('A','a')) and dic[j].endswith('c'):
#         print(j,dic[j])


# li = ['alex','aric','rain','tom','alice','mike']
# print(len(li))
# li.append('seven')
# print(li)
# li.insert(0,'Tony')
# print(li)
# li[1]='kelly'
# print(li)
# li.remove('aric')
# print(li)
# del li[2]
# print(li)
# del li[0:3]
# print(li)
# li.reverse()
# for i in range(len(li)):
#     print(i,li[i])
# for i,v in enumerate(li):
#     print(i,v)


# li = ['hello','seven',['mom',['h','kelly'],'all'],123,446]
# print(li[2][1][1])
# li[2][2]='ALL'
# print(li)


# tu = ('alex','eric','rain')
# print(len(tu))
# print(tu[1])


# tu = ('alex',[11,22,{'k1':'v1','k2':['age','name'],'k3':(11,22,33)},44])
# tu[1][2]['k2'].append('seven')
# print(tu)


# dic = {'k1':'v1','k2':'v2','k3':[11,22,33]}
# print('|'.join(dic.keys()))
# # for i in dic.keys():
# #     print(i,end='|')
# for i in dic:
#     print(i,dic[i])
# for j,v in dic.items():
#     print(j,v)
# dic['k4']='v4'
# dic['k1']='alex'
# print(dic)
# dic['k3'].append(44)
# print(dic)


# s='alex'
# print(list(s))
# print(tuple(s))

# 9
import random
# a=random.randint(0,10)
# b=random.randint(0,10)
# li = ['alex','seven']
# value=[a,b]
# d=dict(zip(li,value))
# print(d)
d={}
li = ['alex','seven']
for i in li:
    d[i]=random.randint(0,10)
print(d)


# l1 = [11, 22, 33]
# l2 = [22, 33, 44]
# print(set(l1)-set(l2))
# print(set(l1)&set(l2))


# 12.
# a=[]
# for i in range(100,-1,-2):
#     a.append(i)
# print(a)


# name=["alice","tome","lice"]
# score=[100,99,88]
# d=dict(zip(name,score))
# print(d)


# def score(name, yw=0, *args, **kwargs):
#     print(name)  # ①zhang
#     print(yw)   # ②100
#     print(args)  #③
#     print(kwargs)  #④
# d={"数学":85}
# score("zhang",100,99,98,**d)